package com.combetter.changxing.collections;

import android.support.annotation.IntDef;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Created by Mark.fan on 2018/5/14.
 */

public class LayoutManagers {
    protected LayoutManagers(){
    }

    public interface LayoutManagerFactory{
        LinearLayoutManager create(RecyclerView recyclerView);
    }

    public static LayoutManagerFactory linear() {
        return new LayoutManagerFactory() {
            @Override
            public LinearLayoutManager create(RecyclerView recyclerView) {
                return new LinearLayoutManager(recyclerView.getContext());
            }
        };
    }

    @IntDef({LinearLayoutManager.HORIZONTAL, LinearLayoutManager.VERTICAL})
    @Retention(RetentionPolicy.SOURCE)
    public @interface Orientation {
    }

}
